package com.prs.crm.domain.crm;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.hr.Person;

@Entity
@Table(name="crm_feedback")
public class Feedback extends BaseEntity{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@ManyToOne
	private Customer customer;
	@ManyToOne
	private FeedbackType type;
	private String feedbacker;
	private String feedbackWay;
	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	@Lob
	private String summary;
	private String isReply;
	private Date replyDate;
	private String title;
	@ManyToOne
	private Person replyer;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public FeedbackType getType() {
		return type;
	}
	public void setType(FeedbackType type) {
		this.type = type;
	}
	public String getFeedbacker() {
		return feedbacker;
	}
	public void setFeedbacker(String feedbacker) {
		this.feedbacker = feedbacker;
	}
	public String getFeedbackWay() {
		return feedbackWay;
	}
	public void setFeedbackWay(String feedbackWay) {
		this.feedbackWay = feedbackWay;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getIsReply() {
		return isReply;
	}
	public void setIsReply(String isReply) {
		this.isReply = isReply;
	}
	public Date getReplyDate() {
		return replyDate;
	}
	public void setReplyDate(Date replyDate) {
		this.replyDate = replyDate;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTitle() {
		return title;
	}
	public void setReplyer(Person replyer) {
		this.replyer = replyer;
	}
	public Person getReplyer() {
		return replyer;
	}

}
